package org.nt4b.schemadoc.webgui.service;

import java.util.List;

import org.nt4b.schemadoc.core.dom.SchemaComments;
import org.nt4b.schemadoc.core.dom.Table;
import org.nt4b.schemadoc.webgui.ConnectionConfiguration;


public interface CommentsService {
    
    /**
     * Loads and returns list of tables.
     * 
     * @param connectionConfiguration
     * @return
     */
    List<Table> loadSchemaComments(final ConnectionConfiguration connectionConfiguration);
    
    /**
     * Loads and returns list of tables.
     * 
     * @param connectionConfiguration
     * @return
     */
    List<Table> loadTablesComments(final ConnectionConfiguration connectionConfiguration);
    
    /**
     * Loads and returns comments of a single table
     * 
     * @param connectionConfiguration
     * @return
     */
    Table loadColumnComments(final ConnectionConfiguration connectionConfiguration, final String tableName);
    
    /**
     * 
     * @param connectionConfiguration
     * @param schemaComments
     */
    void saveSchemaComments(final ConnectionConfiguration connectionConfiguration, final SchemaComments schemaComments);
    
    /**
     * Saves comments of all tables but only table comments
     * Table's in a list just no have any column comments -> would not saved
     * 
     * @param connectionConfiguration
     * @param tables
     */
    void saveTableComments(final ConnectionConfiguration connectionConfiguration, final List<Table> tables);
    
    /**
     * Saves comments of single table with column comments
     * 
     * @param connectionConfiguration
     * @param table
     */
    void saveColumnComments(final ConnectionConfiguration connectionConfiguration, final Table table);
    
}